<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>
<body>
	<script>
		let obj ={
			name:'hh',
			age:12
		}
		obj[Symbol.iterator]=function(){
			let _this=this
			let index=0
			let objKeys=Object.keys(this)
			return {
				next:function(){
					if(index<objKeys.length){
						let res={
							value: _this[objKeys[index]],
							done:false
						}
						index++
						return res
					}else{
						return{
							value:undefined,
							done:true
						}
					}
				}
			}
		}
		for(let a of obj){
			console.log(a);
		}
	</script>
</body>
</html>